import { useEffect } from 'react'

export default function useBus(cb) {
  useEffect(() => {
    const off = cb()
    return () => {
      off()
    }
  }, [cb])
}
